#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
class Solution {
public:
    bool judgeCircle(string moves)
    {
        int x = 0;
        int y = 0;
        for (int i = 0; i < moves.size(); i++)
        {
            if (moves[i] == 'U')
                y++;
            if (moves[i] == 'D')
                y--;
            if (moves[i] == 'L')
                x--;
            if (moves[i] == 'R')
                x++;
        }
        if (x == 0 && y == 0)
            return true;
        else
            return false;
    }
};
int main()
{
    Solution s1;
    string moves;
    cin >> moves;
    s1.judgeCircle(moves);
	return 0;
}